package com.ali.demo.unicom.dao;

import java.util.List;

import org.mybatis.spring.support.SqlSessionDaoSupport;

import com.ali.demo.unicom.domain.Demo;

public class DemoDAO extends SqlSessionDaoSupport {

    public Long generateID() {
	return getSqlSession().selectOne("demo.generateID");
    }

    public void insert(Demo demo) {
	getSqlSession().insert("demo.insert", demo);
    }

    public void insertBatch(List<Demo> demos) {
	getSqlSession().insert("demo.insertBatch", demos);
    }

    public void update(Demo demo) {
	getSqlSession().update("demo.updateByID", demo);
    }

    public Demo selectByID(long id) {
	return (Demo) getSqlSession().selectOne("demo.selectByID", id);
    }
}
